﻿using MiniFox.Resources;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Sys.Core.Models.Dto
{
    /// <summary>
    /// 
    /// </summary>
    public class MenuDto
    {
        /// <summary>
        /// 菜单ID
        /// </summary>
        [Key, Editable(false)]
        [StringLength(46, ErrorMessageResourceType = typeof(CommonMessages), ErrorMessageResourceName = "MSG_CommonStringLength")]
        [JsonProperty("menuId")]
        public string? MenuID { get; set; }
        /// <summary>
        /// 
        /// </summary>
        [Required(ErrorMessageResourceType = typeof(CommonMessages), ErrorMessageResourceName = "MSG_CommonRequired")]
        [JsonProperty("appId")]
        public string ApplicationID { get; set; }
        /// <summary>
        /// 父级ID
        /// </summary>
        [Key, Editable(false)]
        [Required(ErrorMessageResourceType = typeof(CommonMessages), ErrorMessageResourceName = "MSG_CommonRequired")]
        [JsonProperty("parentMenuId")]
        public string ParentMenuID { get; set; }
        /// <summary>
        /// 
        /// </summary>
        [Required(ErrorMessageResourceType = typeof(CommonMessages), ErrorMessageResourceName = "MSG_CommonRequired")]
        [MaxLength(20, ErrorMessageResourceType = typeof(CommonMessages), ErrorMessageResourceName = "MSG_CommonStringLength")]
        [JsonProperty("menuName")]
        public string MenuName { get; set; }
        /// <summary>
        /// 
        /// </summary>
        [JsonProperty("label")]
        public string? Label { get; set; }
        /// <summary>
        /// 菜单图标
        /// </summary>
        [JsonProperty("icon")]
        public string? Icon { get; set; }
        /// <summary>
        /// 排序值
        /// </summary>
        [JsonProperty("ordinal")]
        public int? Ordinal { get; set; }
        [JsonIgnore]
        public string? MenuPath { get; set; }
    }
}
